package com.seis_645.appTesting;

import android.app.TabActivity;
import android.content.Intent;
//import android.content.res.Resources;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TabHost;

public class TestDriveTabWidget extends TabActivity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tablayout);
		// Resources res = getResources();
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;

		intent = new Intent().setClass(this, CarGroupActivity.class);
		spec = tabHost.newTabSpec("Hello").setIndicator("Cars")
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, DealerGroupActivity.class);
		spec = tabHost.newTabSpec("Dealers").setIndicator("Dealers")
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, SalespersonGroupActivity.class);
		spec = tabHost.newTabSpec("Sales People").setIndicator("Sales People")
				.setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, CarGroupActivity.class);
		spec = tabHost.newTabSpec("Cars").setIndicator("Cars")
				.setContent(intent);
		tabHost.addTab(spec);
		
		tabHost.setCurrentTab(2);

		int width = getWindowManager().getDefaultDisplay().getWidth();

		tabHost.setCurrentTab(0);
		for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
			tabHost.getTabWidget()
					.getChildAt(i)
					.setLayoutParams(
							new LinearLayout.LayoutParams((width / 3) - 2, 50));
		}

	}

	

}
